import { requestClient } from '#/api/request';

export namespace OrderApi {
  /** 订单列表接口参数 */
  export interface OrderListParams {
    current_page?: number;
    page_size?: number;
    status?: number;
  }

  /** 订单信息接口 */
  export interface OrderInfo {
    id: number;
    order_no: string;
    user_id: number;
    amount: number;
    status: string;
    create_time: string;
    update_time: string;
  }
}

/**
 * 获取订单列表
 */
export async function getOrderListApi(params: OrderApi.OrderListParams) {
  return requestClient.post<OrderApi.OrderInfo[]>('/v1/order/list', params);
}
